package com.wmb.control;

import com.wmb.bean.UserinfoBean;
import com.wmb.service.LoginService;

public class LoginControl {
    //为了体现LoginService类与LoginControl的关系，从而进行注入
    LoginService loginService;
    UserinfoBean userinfoBean;

    public boolean loginControl(){

        boolean canlogin = false;
        //获取UserinfoBean对象
        //UserinfoBean userinfoBean = new UserinfoBean();
        //userinfoBean.setUserName("张三");
        //获取LoginService对象，传递userinfoBean参数
        //loginService = new LoginService();
        //调用登录方法
        canlogin = loginService.loginService(userinfoBean);
        return canlogin;

        //使用spring容器进行各类之间的调用:
        // 替换为LoginService service变量,因为LoginService类是在LoginControl中调用的，为了体现LoginService类与LoginControl的关系，从而进行注入

    }

    public LoginService getLoginService() {
        return loginService;
    }

    public void setLoginService(LoginService loginService) {
        this.loginService = loginService;
    }

    public UserinfoBean getUserinfoBean() {
        return userinfoBean;
    }

    public void setUserinfoBean(UserinfoBean userinfoBean) {
        this.userinfoBean = userinfoBean;
    }
}
